package com.rm.zeyou.mapper;

import com.rm.zeyou.entity.CouponConfig;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.rm.zeyou.vo.response.SelectCouponResponseVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 优惠卷配置表 Mapper 接口
 * </p>
 *
 * @author YanYang
 * @since 2025-03-12 15:55:07
 */
@Mapper
public interface CouponConfigMapper extends BaseMapper<CouponConfig> {

    @Select("select * from t_coupon_config  where  coupon_status = 1 and coupon_type != 0 and coupon_total >0 order by create_time desc")
    List<SelectCouponResponseVo> selectCouponList();

    @Select("select * from t_coupon_config where coupon_type = 0 and coupon_status = 1 and coupon_total >0")
    List<CouponConfig> selectNewCouponList();

}
